package com.tdcoding.chat.constants;


public class ChatConstants {
	// --------------- 加密常量集 -------------------------------------
	public static final boolean NEED_SSL = false;// 是否需要ssl加密
	public static final String SSL_PASSWORD = "tdc@1A2D3G4J5N6P7S8V9Y0";
	
	// -------------------------------------- 连接常量集 -------------------


	public static final int SERVER_CHAT_PORT = 9090;
	
	public static final int SERVER_VIDEO_PORT = 9091;
	public static final int SERVER_AUDIO_PORT = 9092;

	public static final int SERVER_CONN_TIMEOUT = 5000;
	public static final int SERVER_CPU_COUNT=  Runtime.getRuntime().availableProcessors() ;
	
	public static final int SERVER_BOSS_THREADS =  SERVER_CPU_COUNT * 2;
	public static final int SERVER_WORK_THREADS =  SERVER_CPU_COUNT * 100;

	public static final int SERVER_THREAD_POOL = 64;// 最大线程池数
	public static final int SERVER_RECONN_COUNT = 5;// 尝试绑定服务次数
//	public static final int SERVER_DISPATCHER_THREADS = 50;

	/*********************************************业务请求 ************************************************/
	
	public static final int MSG_SEND_SENDING= 0x0;
	public static final int MSG_SEND_RECEIPT= 0x1;
	public static final int MSG_SEND_SUCCESS= 0x2;
	public static final int MSG_SEND_FAILURE= -0x1;

	public static final String PING = "ping";
	public static final String PONG = "pong";
	public static final String LOGIN = "login";
	public static final String REGISTER = "register";
	public static final String CONFLICT = "conflict";
	public static final String MSG_SEND = "msg_send";
	public static final String MSG_RECEIVE = "msg_receive";
	public static final String MSG_RECEIPT = "msg_receipt";
	public static final String UPDATE_STATUS = "update_status";
	public static final String UPDATE_CHATINFO = "update_chatInfo";
	
	/**
	 *  ------------------------------------------- 聊天消息常量 ------------------------------------------------
	 * 	0单聊、1群聊、2通知、 3推送
	 * 
	 * 0、单聊（0文本，1图片，2语音，3文件）
	 * 1、群聊（0文本，1图片，2语音，3文件）
	 * 2、通知（20上线通知、21邮件提醒、22空间提醒、23个人通知、24群通知）
	 * 	---个人通知（230申请好友、231同意好友、232拒绝好友、233删除好友、234拉黑、236取消拉黑）
	 * ---群通知（240群助手、241申请加群、242邀请加群、243同意、244拒绝、245提升管理员、246撤销管理员
	 * 	    ，247管理员禁言、248管理员取消禁言、249个人禁言、2410个人取消禁言、2411退群、2412踢人、2413解散群）
	 * 3、推送（30单图文，31图文列表）
	 */
	
	//系统ID
	public static final long CHAT_ADMINISTRATOR= 1000000000000l;
	
	public static final int CHAT_TYPE_SINGLE = 0x0;
	public static final int CHAT_TYPE_GROUP = 0x1;
	public static final int CHAT_TYPE_USER_NOTICE = 0x2;
	public static final int CHAT_TYPE_GROUP_NOTICE = 0x3;
	public static final int CHAT_TYPE_ZONE_NOTICE = 0x4;
	public static final int CHAT_TYPE_EMAIL_NOTICE = 0x5;
	public static final int CHAT_TYPE_NEWS_NOTICE = 0x6;
	public static final int CHAT_TYPE_REDPACKET_NOTICE = 0x7;
	
	public static final int CHAT_BODYTYPE_TEXT = 0x0;
	public static final int CHAT_BODYTYPE_IMG = 0x1;
	public static final int CHAT_BODYTYPE_VOICE = 0x2;
	public static final int CHAT_BODYTYPE_FILE = 0x3;
	
	public static final int CHAT_BODYTYPE_ONLINE = 20;
	public static final int CHAT_BODYTYPE_EMAIL = 21;
	public static final int CHAT_BODYTYPE_ZONE = 22;
	public static final int CHAT_BODYTYPE_NEWS= 30;
	
	public static final int CHAT_BODYTYPE_MK_FRIEND = 230;
	public static final int CHAT_BODYTYPE_AGREE_FRIEND = 231;
	public static final int CHAT_BODYTYPE_REFUSE_FRIEND = 232;
	public static final int CHAT_BODYTYPE_REMOVE_FRIEND = 233;
	public static final int CHAT_BODYTYPE_PULL_BLACKLIST = 234;
	public static final int CHAT_BODYTYPE_CANCEL_BLACKLIST = 235;
	
	public static final int CHAT_BODYTYPE_GROUP_ASSISTANT = 240;
	public static final int CHAT_BODYTYPE_JOIN_TO_GROUP = 241;
	public static final int CHAT_BODYTYPE_INVITE_TO_GROUP= 242;
	public static final int CHAT_BODYTYPE_AGREE_JOIN_GROUP = 243;
	public static final int CHAT_BODYTYPE_REFUSE_JOIN_GROUP = 244;
	public static final int CHAT_BODYTYPE_AGREE_INVITE_GROUP = 245;
	public static final int CHAT_BODYTYPE_REFUSE_INVITE_GROUP = 246;
	public static final int CHAT_BODYTYPE_AUTHORIZED_ADMIN = 247;
	public static final int CHAT_BODYTYPE_REVOKED_ADMIN = 248;
	public static final int CHAT_BODYTYPE_GROUP_SHUTUP = 249;
	public static final int CHAT_BODYTYPE_GROUP_CANCELIT = 2410;
	public static final int CHAT_BODYTYPE_MEMBER_SHUTUP = 2411;
	public static final int CHAT_BODYTYPE_MEMBER_CANCELIT = 2412;
	public static final int CHAT_BODYTYPE_QUIT_THE_GROUP = 2413;
	public static final int CHAT_BODYTYPE_KICKOUT_MEMBER= 2414;
	public static final int CHAT_BODYTYPE_TRANSFER_GROUP= 2415;
	public static final int CHAT_BODYTYPE_DISSOLVE_GROUP= 2416;
}
